<?php

// +----------------------------------------------------------------------
// | Apprh.Shop
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2027 http://www.apprh.com All rights reserved.
// +----------------------------------------------------------------------
// | Notice: This code is not open source, it is strictly prohibited
// |         to distribute the copy, otherwise it will pursue its
// |         legal responsibility.
// +----------------------------------------------------------------------
// | Author: 雲溪荏苒 <290648237@qq.com>
// +----------------------------------------------------------------------

namespace app\frontend\controller;

use controller\HomeBase;


/**
 * 友链控制器
 * Class Links
 * @package app\home\controller
 * @author 雲溪荏苒 <290648237@qq.com>
 * @date 2017/10/26
 */
class Links extends HomeBase
{


    public function index()
    {

        // 获取所有单页文章
        $articleList = D('article')->getArticleList();
        $this->assign('articleList', $articleList);

        // 获取合作单位
        $hzLinks = M('links')->where(['type' => 2, 'end_time' => ['gt', time()]])->order('sort asc')->select();
        $this->assign('hzLinks', $hzLinks);

        // 获取友情链接
        $yqLinks = M('links')->where(['type' => 1, 'end_time' => ['gt', time()]])->order('sort asc')->select();
        $this->assign('yqLinks', $yqLinks);
//        dump($articleList);die;

        $this->assign('bread_title', '友情链接');


        // SEO
        $this->assign('seo_title', '友情链接_'.sysconf('seo_title'));
        $this->assign('seo_keywords', sysconf('seo_keywords'));
        $this->assign('seo_description', sysconf('seo_description'));

        return $this->fetch('index');
   }



}
